﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace 自定义控件.Views
{
    /// <summary>
    /// LoginWindow.xaml 的交互逻辑
    /// </summary>
    public partial class LoginWindow : Window
    {
        private List<DataItem> list = new List<DataItem>();
        public LoginWindow()
        {
            InitializeComponent();
            Random random = new Random();
            for (int i = 0;i< 1000; i++)
            {
                DataItem item = new DataItem()
                {
                    ID = i,
                    Name = "user:" + i,
                    RegDate = DateTime.Now.AddDays(-i),
                    Rate = random.NextSingle() * 100
                };
               list.Add(item);
            }
            lv.ItemsSource = list;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
        }
    }

    public class DataItem
    {
        public int ID { get; set; }
        public string Name { get; set; }
        public float Rate { get; set; }
        public DateTime RegDate { get; set; }
    }
}
